package com.baiye.www.work.ui;

import com.baiye.www.spring.ioc.factory.AnnotatedBeanFactory;
import com.baiye.www.work.service.IAccountService;


/**
 * 模拟一个表现层，用于调用业务层
 */
public class Client {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        //IAccountService as = new AccountServiceImpl();
        AnnotatedBeanFactory annotatedBeanFactory = new AnnotatedBeanFactory();
        annotatedBeanFactory.init("com.baiye.www.work");
        for (int i = 0; i < 5; i++) {
            IAccountService as = (IAccountService) annotatedBeanFactory.getBean("IAccountService");
            System.out.println(as);
            as.saveAccount();
        }

    }
}
